<?php
require('./inc/global.php');
$get=getParameters();
$type=isset($get['act'])?$get['act']:'';
if($type=='outlogin'){
	$url=$wwwroots.'/'.ADMINROOT.'/index.php';
	$_SESSION[ADMINSESSION]=null;
	unset($_SESSION[ADMINSESSION]);
	YKT_error('正在退出系统...',$url);
}else{
	$post=getParameters('post');
	$user=isset($post['username'])?$post['username']:'\'';
	$pass=isset($post['password'])?$post['password']:'\'';
	$code=isset($post['checkcode'])?$post['checkcode']:null;
	$codes=isset($_SESSION[IMAGESESSIONNAME])?$_SESSION[IMAGESESSIONNAME]:null;
	if(strtolower($code) != $codes){
		YKT_error('验证码错误！！',$_SERVER['HTTP_REFERER']);
	}
	if(!issql($user) || !issql($user)){
		YKT_error('非法的登陆！！',$_SERVER['HTTP_REFERER']);
	}
	$admin =new admin();
	$admin->checklogin($user,$pass,$code);
}
?>